<?php

/**
 * Rental form base class.
 *
 * @package    juvenalis
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseRentalForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'prefix'      => new sfWidgetFormInput(),
      'suffix'      => new sfWidgetFormInput(),
      'title'       => new sfWidgetFormInput(),
      'description' => new sfWidgetFormTextarea(),
      'rating'      => new sfWidgetFormInput(),
      'broken'      => new sfWidgetFormInputCheckbox(),
      'deleted'     => new sfWidgetFormInputCheckbox(),
      'turnover'    => new sfWidgetFormInput(),
      'rents'       => new sfWidgetFormInput(),
      'note'        => new sfWidgetFormTextarea(),
      'place'       => new sfWidgetFormInput(),
      'price_id'    => new sfWidgetFormPropelChoice(array('model' => 'Price', 'add_empty' => true)),
      'carrier_id'  => new sfWidgetFormPropelChoice(array('model' => 'Carrier', 'add_empty' => true)),
      'created_at'  => new sfWidgetFormDateTime(),
      'updated_at'  => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'Rental', 'column' => 'id', 'required' => false)),
      'prefix'      => new sfValidatorString(array('max_length' => 255)),
      'suffix'      => new sfValidatorInteger(),
      'title'       => new sfValidatorString(array('max_length' => 255)),
      'description' => new sfValidatorString(array('required' => false)),
      'rating'      => new sfValidatorInteger(array('required' => false)),
      'broken'      => new sfValidatorBoolean(),
      'deleted'     => new sfValidatorBoolean(),
      'turnover'    => new sfValidatorNumber(),
      'rents'       => new sfValidatorInteger(),
      'note'        => new sfValidatorString(array('required' => false)),
      'place'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'price_id'    => new sfValidatorPropelChoice(array('model' => 'Price', 'column' => 'id', 'required' => false)),
      'carrier_id'  => new sfValidatorPropelChoice(array('model' => 'Carrier', 'column' => 'id', 'required' => false)),
      'created_at'  => new sfValidatorDateTime(array('required' => false)),
      'updated_at'  => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('rental[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Rental';
  }


}
